Skip to content

refactor(review): remove the review stage modules the pipeline never calls - #561

Merged
dan-petty merged 1 commit into
release/v0.2.23from
refactor/530-remove-unused-review-stages
Sep 25, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
refactor/530-remove-unused-review-stages

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Closes #530.

Why

Six of the seven run_*_stage functions in ai/review/stages/ had no caller. They duplicated the pipeline's logic and had drifted from it: static_scan.py still printed "Static analyzers completed (0 finding(s) detected)" and never called Trivy (#516). Tests imported them, which kept them looking alive.

Changes

  • Removed:

    • pre_analysis.py, static_scan.py, persona_review.py, verification.py and reranking.py;
    • run_reporting_stage from reporting.py.

    stages now exports only what the pipeline uses: the adversarial debate and the report's executive summary.

  • Guards moved onto the pipeline, which lacked them:

    • ReviewPipelineOrchestrator refuses a session directory with a .. component, or one outside the reviews, working or temporary directory, before writing to it (as run_reporting_stage checked).
    • _resolve_file_path resolves only to files inside the review target or its repository. A path outside both, absolute or through .., falls back to a missing in-target path (as _resolve_target_path required). Previously it returned any existing absolute path.

Test plan

  • Tests of removed functions deleted; tests/test_review_stages.py keeps the adversarial debate test
  • tests/test_subsystem_containment_and_redaction.py: session-directory and file-path containment now tested on the pipeline
  • No remaining references to the removed code in src/, tests/ or docs/
  • uv run devops ci --force: all 13 gates pass

…calls

Six of the seven run_*_stage functions in ai/review/stages had no caller. They duplicated
the pipeline's logic and had drifted from it: the static scan stage still printed a
misleading "completed" message and never called Trivy. Tests imported them, which kept
them looking alive.

Removed: pre_analysis, static_scan, persona_review, verification and reranking, and
run_reporting_stage. stages keeps the adversarial debate and the report's executive
summary.

Two guards moved onto the pipeline, which lacked them. The orchestrator refuses a
session directory with `..` or outside the reviews, working or temporary directory.
_resolve_file_path resolves only inside the review target or its repository; it used to
return any existing absolute path.

Closes #530
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 25, 2026
@dan-petty dan-petty added type/refactor Type refactor: a new structure, same behavior scope/review Multi-persona code review engine, verification, and findings priority/p2-medium Priority P2: standard work labels Sep 25, 2026
@dan-petty
dan-petty merged commit 43b2226 into release/v0.2.23 Sep 25, 2026
7 checks passed
@dan-petty
dan-petty deleted the refactor/530-remove-unused-review-stages branch September 25, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/p2-medium Priority P2: standard work scope/review Multi-persona code review engine, verification, and findings type/refactor Type refactor: a new structure, same behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant